package service

import (
	"context"
	"github.com/bitly/go-simplejson"
	"go.mongodb.org/mongo-driver/mongo"
	"go.uber.org/zap"
	OrgRate "golang.org/x/time/rate"
	"sync"
	//kelleyRabbimqPool "gitee.com/tym_hmm/rabbitmq-pool-go"
	"webhook-alarm/rabbitmqpool"
)

var welcome = `
          ##########     ########       ########       #       #
              #          #       #      #       #      #       #
              #          # -   -  #     # -   -  #     #       #
              #          #   -    #     #   -    #     #########
              #          #   =    #     #   =    #     #       #
              #          #       #      #       #      #       #
              #          ########       ########       #       #
`

var ZapLog *zap.Logger

type Handler struct {
	wechat *simplejson.Json
}

var MyHandler = &Handler{}
var token map[string]string
var GroupMap map[string]interface{}
var limiteRate OrgRate.Limit
var limit *OrgRate.Limiter
var contextValue = context.Background()

var oncePool sync.Once
var instanceRPool *kelleyRabbimqPool.RabbitPool

var onceConsumePool sync.Once
var instanceConsumePool *kelleyRabbimqPool.RabbitPool

var MongodbClient *mongo.Client

type SentryMsg struct {
	TraceId       string
	Project       string
	Issue_service string
	Issue_id      string
	Issue_message string
	Issue_culprit string
	Issue_url     string
}

type SkyMsg struct {
	TraceId      string
	Scope        string
	Name         string
	RuleName     string
	AlarmMessage string
}
